<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    


    <script>
    //   声明函数
      function fn(){
        //   定义变量接收和、差、积、商
          var sum = arguments[0]
          var cha = arguments[0]
          var cheng = arguments[0]
          var shang = arguments[0]
        // 遍历求和、差、积、商
          for(var i = 1;i<arguments.length;i++){
                sum += arguments[i]
                cha -= arguments[i]
                cheng *= arguments[i]
                shang /= arguments[i]
          }
        //   打印
          console.log('和为' + sum);
          console.log('差为' + cha);
          console.log('积为' + cheng);
          console.log('商为' + shang);
          
      }


      fn(4,5,8,7,6)

       


        
        
            
   


      


       

        
    </script>
</body>
</html>